import java.util.*;

/**
 * @author LKQ
 * @date 2022/4/9 10:04
 * @description HashSet
 */
public class Solution3 {
    public static void main(String[] args) {

    }
    public List<String> findRepeatedDnaSequences(String s) {
        if (s.length() <= 10 ) {
            return new ArrayList<>();
        }
        Set<String> set = new HashSet<>(), res = new HashSet<>();
        for (int i = 0; i <= s.length() - 10; i++) {
            String str = s.substring(i, i + 10);
            if (!set.add(str)) {
                res.add(str);
            }
        }
        return new ArrayList<>(res);
    }
}
